<?php
/**
 * @author 
 * @copyright 2015
 */

class homeModel extends CI_Model
{
	function __construct(){
		parent::__construct('');
	}
	function Gets(){
		$this->db->where('parent <>',0);
        $this->db->where('title <>','sep');
		$query = $this->db->get('menus');
		if($query->num_rows()>0)
		{
	
			$result=$query->result_array();
            $tt = array();
            foreach($result as $item)
            {
                $t = $item['params'];
                $t = explode(',',$t);
                $aa = array();
                foreach($t as $it)
                {
                    $aa[$it] = '';
                }
                $tt[$item['id']]=$aa;
            }
            echo json_encode($tt);
		}
		return false;
	}
}